﻿@model Digital.Contact.Models.TemplateModel

@{
    ViewBag.IsTemplate = "class=open";
    ViewBag.Title = "Edit";
    Layout = "~/Views/Shared/_LayoutDigital.cshtml";
}



<div class="row">

    <div class="col-md-12">



        <div class="widget">
            <div class="widget-head">
                <div class="pull-left">Quick Posts</div>
                <div class="clearfix"></div>
            </div>
            <div class="widget-content">
                <div class="padd">
                    <div class="form quick-post">
                        @using (Html.BeginForm("Edit", "Template", FormMethod.Post, new { @class = "form-horizontal" }))
                        {
                            @Html.AntiForgeryToken()



                            @Html.ValidationSummary(true)
                            @Html.HiddenFor(model => model.TemplateID)

                            <div class="form-group">
                                <label class="control-label col-lg-1" for="title">@Html.DisplayNameFor(model => model.Name)</label>
                                <div class="col-md-8">
                                    @Html.TextBoxFor(model => model.Name, new { @class = "form-control", Id = "Name" })
                                    @Html.ValidationMessageFor(model => model.Name)

                                </div>
                            </div>

                            <div class="form-group">
                                <label class="control-label col-lg-1" for="title">@Html.DisplayNameFor(model => model.TableName)</label>
                                <div class="col-md-8">
                                    @Html.TextBoxFor(model => model.TableName, new { @class = "form-control", Id = "TableName" })
                                    @Html.ValidationMessageFor(model => model.TableName)

                                </div>
                            </div>
                            if (Model.TemplateID != 0)
                            {
                                <div class="form-group">
                                    <label class="control-label col-lg-1" for="title"></label>
                                    <div class="col-md-8">
                                        <button type="button" onclick="javascript:window.location.href='../Template/ColumnList?TempId=@Model.TemplateID'" class="btn btn-primary">字段编辑</button>

                                    </div>
                                </div>
                            }
                            <div class="form-group">
                                <!-- Buttons -->
                                <div class="col-lg-offset-2 col-lg-9">
                                    <button type="submit" class="btn btn-danger">保 存</button>
                                </div>
                            </div>



                        }
                    </div>
                </div>
                <div class="widget-foot">
                    <!-- Footer goes here -->
                </div>
            </div>
        </div>
    </div>
</div>
